package cn.kgc.tangcco.controller;

import cn.kgc.tangcco.pojo.Idiom;
import cn.kgc.tangcco.service.IdiomService;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 李昊哲
 * @Description
 * @create 2021/1/27 11:59
 */
@RestController
@RequestMapping(value = "/idiom")
public class IdiomController {
    private final IdiomService idiomService;

    public IdiomController(IdiomService idiomService) {
        this.idiomService = idiomService;
    }

    @PostMapping(value = "/page")
    public Page<Idiom> page(Integer page, Integer limit){
        return  idiomService.finAll(page,limit);
    }
}
